/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Mansur
 */
@Entity
@Table(name = "ship_visitfl_history")
@NamedQueries({
    @NamedQuery(name = "ShipVisitFlowHistory.findAll", query = "SELECT s FROM ShipVisitFlowHistory s")})
public class ShipVisitFlowHistory implements Serializable{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ship_visitflh_id")
    private Integer shipVisitFlowHistoryId;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ship_visitfl")
    private ShipVisitFlow shipVisitFlow;
    
    @Column(name = "status_flag")
    private String status;  // K=KIV, A=Approved, R=Rejected
    
    @Column(name = "reject_note")
    private String rejectNote;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "verifier_id")
    private User verifierId;
    
    @Embedded
    private InfoAudit infoAudit;
    
    public ShipVisitFlowHistory(){
        
    }

    public Integer getShipVisitFlowHistoryId() {
        return shipVisitFlowHistoryId;
    }

    public void setShipVisitFlowHistoryId(Integer shipVisitFlowHistoryId) {
        this.shipVisitFlowHistoryId = shipVisitFlowHistoryId;
    }

    public ShipVisitFlow getShipVisitFlow() {
        return shipVisitFlow;
    }

    public void setShipVisitFlow(ShipVisitFlow shipVisitFlow) {
        this.shipVisitFlow = shipVisitFlow;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getRejectNote() {
        return rejectNote;
    }

    public void setRejectNote(String rejectNote) {
        this.rejectNote = rejectNote;
    }

    public User getVerifierId() {
        return verifierId;
    }

    public void setVerifierId(User verifierId) {
        this.verifierId = verifierId;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (shipVisitFlowHistoryId != null ? shipVisitFlowHistoryId.hashCode() : 0);
        return hash;
    }
    
    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ShipVisitFlowHistory)) {
            return false;
        }
        ShipVisitFlowHistory other = (ShipVisitFlowHistory) object;
        if ((this.shipVisitFlowHistoryId == null && other.shipVisitFlowHistoryId != null) || (this.shipVisitFlowHistoryId != null && !this.shipVisitFlowHistoryId.equals(other.shipVisitFlowHistoryId))) {
            return false;
        }
        return true;
    }
    
    @Override
    public String toString() {
        return "exatrez.model.ShipVisitFlowHistory[ shipVisitFlowHistoryId=" + shipVisitFlowHistoryId + " ]";
    }
}
